//
//  CustomView.m
//  WE
//
//  Created by iMacOne on 15/11/18.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "CustomView.h"
#import "Head.h"
@interface CustomView()
@property (nonatomic, strong)UIImageView * iconImageView;
@property (nonatomic, strong)UILabel * titleLabel;
@property (nonatomic, strong)UILabel * introLabel;
@property (nonatomic, strong)UILabel * contentLabel;
@property (nonatomic, strong)UILabel * teamLabel;


@end

@implementation CustomView
- (void )creatView
{
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(margin_5, margin_5, margin_20, margin_20)];
    _iconImageView.backgroundColor = DEBUG_CLOLR;
    _iconImageView.layer.masksToBounds = YES;
    _iconImageView.layer.cornerRadius = 10;
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_iconImageView.frame) + margin_10, _iconImageView.frame.origin.y, margin_64, margin_15)];
    _titleLabel.font = FONT(14);
//    _titleLabel.backgroundColor = [UIColor blueColor];
    _titleLabel.text = @"陈世益";
    
    self.teamLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_titleLabel.frame), _iconImageView.frame.origin.y, margin_64, margin_15)];
    _teamLabel.font = FONT(12);
    //    _titleLabel.backgroundColor = [UIColor blueColor];
    _teamLabel.text = @"专家团队";

    self.introLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.frame.origin.x, CGRectGetMaxY(_titleLabel.frame) + margin_5, [ToolUtil autoWidth:@"复旦大学附属华山医院" width:0 height:20 num:10] + 5, margin_20)];
    _introLabel.font = FONT(10);
    _introLabel.textColor = [UIColor blackColor];
    _introLabel.text = @"复旦大学附属华山医院 ";
    _introLabel.textAlignment = NSTextAlignmentCenter;
    _introLabel.layer.borderColor = [UIColor orangeColor].CGColor;
    _introLabel.layer.borderWidth = 1;
    
    self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(_iconImageView.frame.origin.x, CGRectGetMaxY(_introLabel.frame), (WindowWidth *2 - 40)/3 - _iconImageView.frame.origin.x, margin_48)];
    _contentLabel.font = FONT(10);
    _contentLabel.numberOfLines = 0;
    _contentLabel.textColor = [UIColor grayColor];
    _contentLabel.text = @"垃圾就留个好垃圾垃圾卡建立了连接了看见了看见了看见了看见了看见就看见快乐健康了";
    
    [self addSubview:_iconImageView];
    [self addSubview:_titleLabel];
    [self addSubview:_introLabel];
    [self addSubview:_contentLabel];
    [self addSubview:_teamLabel];
    self.layer.borderWidth = 1;
    self.layer.borderColor = [UIColor orangeColor].CGColor;
    self.layer.masksToBounds = YES;
    self.layer.cornerRadius = 1;
    self.userInteractionEnabled = YES;
//    UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doTap:)];
//    [self addGestureRecognizer:tap];
}
//- (void)doTap:(UITapGestureRecognizer *)tap
//{
//    
//    [self.delegate doClickView:<#(NSString *)#>]
//}
- (void)creatPersonView
{
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(((WindowWidth - 110)/5 - margin_34) / 2, margin_5, margin_34, margin_34)];
    _iconImageView.backgroundColor = DEBUG_CLOLR;
    _iconImageView.layer.masksToBounds = YES;
    _iconImageView.layer.cornerRadius = 17;
    
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(((WindowWidth - 110)/5 - margin_36) / 2 , CGRectGetMaxY(_iconImageView.frame) + margin_5, margin_36, margin_20)];
    _titleLabel.font = FONT(12);
//    _titleLabel.backgroundColor = [UIColor brownColor];
    _titleLabel.text = @"陈世益";
    
    self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(_titleLabel.frame) + margin_5, [ToolUtil autoWidth:@"副主治医师" width:0 height:20 num:10], margin_20)];
    _contentLabel.font = FONT(10);
    _contentLabel.textAlignment = NSTextAlignmentCenter;
//    _contentLabel.backgroundColor = [UIColor brownColor];
    _contentLabel.text = @"副主治医师";
    
    [self addSubview:_iconImageView];
    [self addSubview:_titleLabel];
    [self addSubview:_contentLabel];
}
- (void)creatImageVAndLblView:(NSString *)imageStr lblText:(NSString *)str
{
    self.iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 10, 20, 20)];
//    _iconImageView.backgroundColor = DEBUG_CLOLR;
    _iconImageView.image = [UIImage imageNamed:imageStr];
    
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_iconImageView.frame)+3, 15, 30, 10)];
    _titleLabel.text = str;
    _titleLabel.font = FONT(10);
    
    [self addSubview:_iconImageView];
    [self addSubview:_titleLabel];
    
}
- (void)creatLblAndArrowImageV
{
    
}




@end
